package com.wuzhun.wxmp.common;

/**
 *
 * @author baolin
 * @date 2022/12/03 14:24 下午
 */
public final class ServiceException extends RuntimeException {
    public String errorCode;
    public String errorMsg;

    public ServiceException(String errorCode, String errorMsg) {
        super(errorMsg);
        this.errorCode = errorCode;
        this.errorMsg = errorMsg;
    }

    public ServiceException(String errorCode, String errorMsg, Throwable cause) {
        super(errorMsg, cause);
        this.errorCode = errorCode;
        this.errorMsg = errorMsg;
    }

    public ServiceException(ResultCode resultCode) {
        super(resultCode.getErrorMessage());
        this.errorCode = resultCode.getErrorCode();
        this.errorMsg = resultCode.getErrorMessage();
    }

    public ServiceException(Throwable cause) {
        super(cause);
    }
}
